/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



package sonia.golf;

//~--- non-JDK imports --------------------------------------------------------

import sonia.golf.dao.DAOFactory;
import sonia.golf.dao.GenericDAO;

/**
 *
 * @author Sebastian Sdorra
 */
public class PlayerActivity extends AbstractDAOListActivity<Player, String>
{

  /**
   * Method description
   *
   *
   * @param name
   *
   * @return
   */
  @Override
  protected Player createNewItem(String name)
  {
    return new Player(name);
  }

  //~--- get methods ----------------------------------------------------------

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  protected GenericDAO<Player, String> getDAO()
  {
    return DAOFactory.getInstance().getPlayerDAO();
  }

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  protected int getMenuId()
  {
    return R.layout.menuplayer;
  }

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  protected int getNewItemMenuId()
  {
    return R.id.menu_new_player;
  }

  /**
   * Method description
   *
   *
   * @return
   */
  @Override
  protected int getNewItemMessageId()
  {
    return R.string.new_player;
  }

  /**
   * Method description
   *
   *
   * @param item
   *
   * @return
   */
  @Override
  protected String getRemoveMessage(Player item)
  {
    return getResources().getString(R.string.remove_player, item.getName());
  }
}
